<ui:component xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:m="http://www.ol4jsf.org"
	xmlns:a4j="http://richfaces.org/a4j">

	<style>
		.noMaskClass .rich-mpnl-mask-div {
			display:none;
		}
		.contentEditData {
			width:100%;
			height:290px;
			overflow:auto;
		}
	</style>
	
	<a4j:region renderRegionOnly="true">
		<rich:modalPanel id="editDataPanelToolbox" width="400" height="420" styleClass="noMaskClass" zindex="10000">
			<f:facet name="header">
				<h:outputText value="#{messages['dataentry.editdata_toolbox_desc']}"/>
			</f:facet>
			
			<f:facet name="controls">
				<h:panelGroup>
					<h:graphicImage value="/img/close.png" styleClass="hidelink"
						id="hideEditDataPanel" />
					<rich:componentControl for="editDataPanelToolbox" attachTo="hideEditDataPanel"
						operation="hide" event="onclick" />
				</h:panelGroup>
			</f:facet>
			
			<h:form>
				<h:messages />
				<rich:tabPanel id="editDataTabPanel" switchType="client" selectedTab="firstTab">
					<rich:tab name="firstTab" label="#{messages['dataentry.editdata.legal_section']}">
						<div class="contentEditData">
							<h:panelGrid id="editDataTab1" columns="2">
								<h:outputText value="#{messages['dataentry.editdata.parcel_name']}" />
								<h:inputText value="#{dataEntryHelper.selectedParcel.parcelName}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}"/>

								<h:outputText value="#{messages['dataentry.editdata.geometry_area']}" />
								<h:inputText value="#{dataEntryHelper.selectedParcel.geometryArea}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}"/>
							
								<h:outputText value="#{messages['dataentry.editdata.documented_area']}" />
								<h:inputText value="#{dataEntryHelper.selectedParcel.documentedArea}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}"/>
							
								<h:outputText value="#{messages['dataentry.editdata.measured_area']}" />
								<h:inputText value="#{dataEntryHelper.selectedParcel.measuredArea}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}"/>
							
								<h:outputText value="#{messages['dataentry.editdata.documented_built_area']}" />
								<h:inputText value="#{dataEntryHelper.selectedParcel.documentedBuiltArea}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}"/>
							
								<h:outputText value="#{messages['dataentry.editdata.ground_built_area']}" />
								<h:inputText value="#{dataEntryHelper.selectedParcel.groundBuiltArea}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}"/>
							
								<h:outputText value="#{messages['dataentry.editdata.neighborhood']}" />
								<h:inputText value="#{dataEntryHelper.selectedParcel.neighborhood}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}"/>

								<h:outputText value="#{messages['dataentry.editdata.access_way1']}" />
								<h:inputText value="#{dataEntryHelper.selectedParcel.accessWay1}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}"/>

								<h:outputText value="#{messages['dataentry.editdata.access_way2']}" />
								<h:inputText value="#{dataEntryHelper.selectedParcel.accessWay2}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}"/>

								<h:outputText value="#{messages['dataentry.editdata.house_number']}" />
								<h:inputText value="#{dataEntryHelper.selectedParcel.houseNumber}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}"/>

								<h:outputText value="#{messages['dataentry.editdata.location_in_country']}" />
								<h:inputText value="#{dataEntryHelper.selectedParcel.locationInCountry}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}"/>
							</h:panelGrid>
						</div>
					</rich:tab>
					<rich:tab label="#{messages['dataentry.editdata.tax_section']}">
						<div class="contentEditData">
							<h:panelGrid id="editDataTab2" columns="2">
								<h:outputText value="#{messages['dataentry.editdata.commercial_appraisal']}" />
								<h:inputText value="#{dataEntryHelper.selectedParcel.commercialAppraisal}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}"/>

								<h:outputText value="#{messages['dataentry.editdata.fiscal_appraisal']}" />
								<h:inputText value="#{dataEntryHelper.selectedParcel.fiscalAppraisal}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}"/>

								<h:outputText value="#{messages['dataentry.editdata.payed_taxes']}" />
								<h:inputText value="#{dataEntryHelper.selectedParcel.payedTaxes}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}"/>

								<h:outputText value="#{messages['dataentry.editdata.status']}" />
								<h:selectOneMenu value="#{dataEntryHelper.selectedParcel.status}" disabled="#{not dataEntryHelper.parcelDataHelper.editing}">
									<f:selectItems value="#{dataEntryHelper.parcelDataHelper.taxStatusTypes}"/>
								</h:selectOneMenu>
							</h:panelGrid>
						</div>
					</rich:tab>
				</rich:tabPanel>
				<br />
				<div align="center">
					<h:panelGroup id="editSaveBtns">
						<a4j:commandButton value="#{messages['button.edit']}" immediate="true"
						action="#{dataEntryHelper.parcelDataHelper.beginEditData}"
						rendered="#{not dataEntryHelper.parcelDataHelper.editing}"
						reRender="editDataTab1,editDataTab2,editSaveBtns">
						</a4j:commandButton>
						<a4j:commandButton value="#{messages['button.save']}"
						action="#{dataEntryHelper.parcelDataHelper.applyDataChange}"
						rendered="#{dataEntryHelper.parcelDataHelper.editing}"
						reRender="editDataTab1,editDataTab2,editSaveBtns">
						</a4j:commandButton>
						#{'  '}
						<a4j:commandButton value="#{messages['button.cancel']}" immediate="true"
						action="#{dataEntryHelper.parcelDataHelper.cancelEditData}"
						rendered="#{dataEntryHelper.parcelDataHelper.editing}"
						reRender="editDataTab1,editDataTab2,editSaveBtns">
						</a4j:commandButton>
					</h:panelGroup>
				</div>
			</h:form>
		</rich:modalPanel>
	</a4j:region>
</ui:component>

